<html lang="zh-CN"><head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="format-detection" content="telephone=no">
	<title>购物车</title>
	<link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/css/common.css{$Think.config.RESOURCE_VER}">
	<link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/css/product.css{$Think.config.RESOURCE_VER}">
	<link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/css/product/product_multi.css{$Think.config.RESOURCE_VER}">
	<link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/css/iconfont/font_tuan.css{$Think.config.RESOURCE_VER}">
	<!-- <script src="http://sdk.talkingdata.com/app/h5/v1?appid=DE13C350F41F5DE78FEC51DB5DE730D1&vn=v2&vc=v2"></script> -->
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.1.1.3.min.js{$Think.config.RESOURCE_VER}"></script>
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.alert.js{$Think.config.RESOURCE_VER}"></script>
	<script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js{$Think.config.RESOURCE_VER}" type="text/javascript"></script>
	<script src="{$Think.config.RESOURCEURL}wx_assets/js/product/product_multi.js{$Think.config.RESOURCE_VER}"></script>
</head>
<style>
	.radio_all
	{
		margin-top:10px;
	}
	.pro-list
	{
		padding-right: 70px;
		position: relative;
		margin-left: 140px;
	}
	.p-pri
	{
		position: absolute;
		top: 0px;
		right: 0px;
		color: {$mallHue.fontColor||default='#f75493'};
		font-size:17px;
	}
	.del_btn
	{
		font-size: 25px;
		color: #333;
		position: absolute;
		bottom: 0;
		right: 5px;
	}
	.del_btn i
	{
		font-size: 25px !important;
		color: #ccc !important;
	}
	#page_intelOrder .myorder{
		margin-bottom:15px !important;
	}
	#page_intelOrder .myorder li{

		padding: 15px 10px;
		/*	box-shadow: 0 1px 1px #ddd;*/
		border:0px !important;
	}
	#page_intelOrder .myorder li:last-of-type{
		padding-bottom:0;
	}
	.pro-list
	{
		margin-left:130px !important;
	}
	.joinOrder{
		float:right;color:{$mallHue.fontColor||default='#f75493'};
	}
	.footer_sub_btn ul li .btn{
		background-color:{$mallHue.mainColor||default='#f75493'};
		border: 1px solid{$mallHue.mainColor||default='#f75493'};
	}
	<if condition="$mallHue.mallHue eq '1'">
	.myorder li .radio, .radio_all{
		background: url({$Think.config.RESOURCEURL}wx_assets/images/product/w_8.png?v=201609131121) no-repeat 50% -578px;
		background-size: cover;
	}
	.myorder li .radio.checked, .radio_all.checked{
		background-position: 50% -618px;
	}
	</if>
</style>
<body id="page_intelOrder" class="myOrderCon" style="width:100%;background-color:#ddd">
<div class="center" style="padding: 0px;">
	<div id="_myOrder">

	</div>
	<!--<ul class="myorder" id="myOrder" style="margin: 0px;box-shadow:none">


    </ul>-->
	<footer>
		<div  class="footer_sub_btn">
			<div class="widget_wrap" >
				<ul>
					<ol style="border:none;border-top: 1px solid #ddd;background-color:white;">
						<li>
							<!--<div id="check" style="width:30px;height:30px;float:left;margin-bottom:5px;position: relative;">
								<div id="checkAll" class="radio radio_all "></div>
								<span style="position: absolute;top: 50%;right: -30px;">全选</span>
							</div>-->
							<div class="price_des" id="price_des" style="text-align: left;margin-left:5px;float:left;padding-right: 20px;box-sizing: border-box;">
								<p style="margin-top: 5px;">总计<span class="price_total ng-binding" id="total" style="font-size: 17px;vertical-align:middle;position: relative;top: -2px;color: {$mallHue.fontColor||default='#f75493'};">0.00</span></p>
								<p class="ng-binding" >(共<span id="num"></span>件，不含运费)</p>
							</div>
							<div>
								<div class="btn" id="buy-now">去结算</div>
							</div>
						</li>
					</ol>
				</ul>
			</div>
		</div>
	</footer>
</div>
<script type="text/html" id="productTpl">
	<%if(productList){
	for(var i=0;i<productList.length;i++){
	var _product = productList[i];
	%>
	<div class="multi_cart">

		<div style="line-height:30px;height:30px;background:white;padding:10px 10px;border-bottom:1px solid #ddd;position: relative;">
			<div style="width:100px;height:30px;left:10px;top:10px;margin-bottom:5px;position: absolute;">
				<div style="display: inline-block;margin-top:0px;" class="radio radio_all  radio_multi" data-id="<%=_product.disInfo.id%>"></div>
				<span style="">全选</span>
			</div>
		</div>
		<%if(_product.disInfo){%>
		<div style="line-height:30px;height:30px;background:white;padding:0px 10px;padding-top:5px;padding-left:50px;position: relative;">
			<span><%=_product.disInfo.name%></span>
			<%if(_product.disInfo.mallUrl){%>
			<a class="joinOrder" href="<%=_product.disInfo.mallUrl%>">去凑单></a>
			<%}%>
		</div>
		<%}%>
		<ul class="myorder"  style="margin: 0px;box-shadow:none;border:0px;">
			<%if(_product.list){%>
			<%for(var y=0;y<_product.list.length;y++){%>
			<%var product = _product.list[y];%>
			<%if(product){%>
			<li class="mli" id="orderD_<%=product.did%>" style="background:white">
				<div style="height:auto;overflow:hidden;padding-bottom:15px;">
					<div style="float:left" name="divRad">
						<div name="good_id" data-did="<%=product.did%>" data-prosource="<%=product.proSource%>" class="radio " data-id="<%=_product.disInfo.id%>" style="margin-top: 31px"></div>
					</div>
					<div style="float:left;width:100px" onClick="onDetail('<%=product.fromCustomerId%>','<%=product.id%>')">
										<span class="img_wrap">
											<%if(product.picUrl1&&product.picUrl1[1]){%>
												<img  src="<%=product.picUrl1[1]['picUrl']%>" >
											<%}else{%>
												<img  src="<%=product.picUrl%>" >
											<%}%>
										</span>
						<figcaption style="width:80px"></figcaption>
					</div>
					<div class="pro-list">
						<div style="-webkit-box-orient: vertical;text-overflow: ellipsis;word-break: break-word;-webkit-line-clamp: 2;display: -webkit-box;">
										<span class="del_btn" data-id="<%=product.did%>">
											<i class="iconfont">&#xe609;</i>
										</span>
							<p style="Line-height:20px;width:100%;text-overflow:ellipsis;overflow:hidden;min-height:40px;" name="product.unitName" onClick="onDetail('<%=product.fromCustomerId%>','<%=product.id%>')">
								<%=product.name%>

											<span class="p-pri">
											￥<%=product.price%>

											</span>
							</p>
							<%if(product.firstSpecName){%>
							<div style="color: #ccc;font-size: 12px;" name="pop" class="prop" data-size="<%=product.firstSpecName%>" data-color="<%=product.secondSpecName%>"><%=product.firstSpecName%>&nbsp;&nbsp;<%=product.secondSpecName%></div>
							<%}%>
							<section class="bbox" style="float:none;margin:0;height:auto">
								<div class="btn-reduce" data-type="reduce" type="button" data-did="<%=product.did%>"></div>
								<input class="numBox" id="numBox_<%=product.did%>" name="numBox" type="text" value="<%=product.reserveCount%>" freePrice="<%=product.freePrice%>" freeBuy="<%=product.freeBuy%>"
									   discountedprice="<%=product.price%>" inventoryCount="<%=product.inventoryCount%>" inventory="<%=product.inventory%>" specCount="<%=product.specCount%>"  readonly="readonly">
								<div class="btn-plus" data-did="<%=product.did%>" data-type="add">  </div></section>
							<p></p>
						</div>
					</div>
				</div>
			</li>
			<%}%>
			<%}%>
			<%}%>
		</ul>
	</div>
	<%}%>

	<%}else{%>
	<style>
		.ui-top
		{
			padding: 0px 60px;
			height: 48px;
			background: #f75493;
			max-width: 640px;
			margin: 0 auto;
			box-sizing: border-box;
		}
		.ui-top a.ui-tBtn
		{
			position: absolute;
			/* line-height: 54px; */
			height: 48px;
			display: block;
			width: 60px;
			top: 0px;
			text-align: center;
			color: white;
			left: 0px;
			top: 0px;
		}
		.ui-top.child .middle
		{
			color: white;
			text-align: center;
			line-height: 46px;
			background: transparent;
			padding: 0px;
			font-size: 20px;
		}
		.ui-top .middle
		{
			height: 48px;
			background: #f2f2f2;
			border-radius: 4px;
			padding-right: 48px;
			position: relative;
		}
		.ui-top.child a.ui-tBtn i
		{
			font-size: 18px !important;
			position: absolute;
			left: 0px;
			right: 0px;
			margin:0 auto;
			top: 50%;
			margin-top: -12px;
		}
		body
		{
			background: white !important;
		}
		footer
		{
			display: none;
		}
	</style>
	<header class="main" style="margin: 0px;">
		<div class="ui-top child">
			<a onclick="history.go(-1);" class="ui-tBtn">
				<i class="iconfont">&#xe60a;</i>
			</a>
			<div class="middle">购物车</div>
		</div>
	</header>
	<img style="width: 70%;margin: 30px auto;display: block;" src="{$Think.config.RESOURCEURL}wx_assets/images/product/car_empty.jpg{$Think.config.RESOURCE_VER}"/>
	<div style="text-align: center;font-size:16px;color:#333">购物车还是空的，您再逛逛吧</div>
		<% if (mall && mall.storeurl) {%>
		<a href="<%=mall.storeurl%>" style="font-size: 16px;display: block;width: 70%;border-radius: 5px;text-align: center;color: white;line-height: 40px;background: #72a0eb;margin: 17px auto;">去首页逛逛</a>
		<%}%>
	<%}%>
</script>
<script type="text/javascript">
	var baseUrl = '{$Think.config.SERVER_HOST}';
	var hrefPath = 'call.html?customerId={$customerId}&userName={$userName}';
	var basePath = 'call.json?customerId={$customerId}';
	var userName="{$userName}";
	var p=$.util.getParamAsObject();
	var buyParams={
		"type": "buy",
		"qId":p.qId,
		"miUId":p.miUId,
		"userName":"{$userName}",
		"shareFromGuid":p.fromGuid,
		"shareId":p.sId,
		"vId":p.vId,
		"proSource":"{$proSource}"
	};
	var distributionId=null;
	function onDetail(formCustomerId,pId){
		var p=$.util.getParamAsObject();
		delete p.sid;
		delete p.type;
		delete p.tplid;
		delete p.mid;
		var pa=$.extend(p,{
			id:pId
		});
		pa=encodeURIComponent(JSON.stringify(pa));
		var detailUrl=baseUrl+'call.html?customerId='+formCustomerId+'&module=product&method=getProduct&params='+pa;
		location.href=detailUrl;
	}
	template.helper("total",function(price,count){
		return (price*count).toFixed(2);
	});
	var productCart={
		pageSize:10,
		page:0,
		init:function(){
			var me=this;
			this._initEvent();
			$.util.pageLoading.show();
			me._loadList(me.page,function(){
				$.util.pageLoading.hide();
			});
		},
		_initEvent:function(){
			var me=this;
			$.util.initDataLoading({
				me:productCart,
				lastChildren:function(){
					return $("#myOrder > li:last");
				},
				page:function(){
					return productCart.page;
				},
				pageCount:function(){
					return productCart.pageCount;
				}
			});
		},
		_renderList:function(data,page,callback){
			var me=this;
			if(data){
				var html=template("productTpl", data),
						container=$("#_myOrder");
				container.append(html);
				me.page=page;
				me.pageCount=data.pageCount;
				callback && callback();
				PRODUCT_MULTI.init();
			}
		},
		_loadList:function(page,callback){
			var me=this;
			$.req.get("call.json?module=product&customerId={$customerId}&method=getCart",{
				userName:"{$userName}",
				params:{
					"sid":p.sid,
					"type":"buy",
					"tplid":p.tplid,
					"mid":p.mid,
					"qId": p.qId,
					"miUId": p.miUId,
					"start":page,
					"limit":me.pageSize
				}
			},function(data){
				if(data){
					me._renderList(data,page,callback);
				}
			});
		}
	}
	productCart.init();
</script>


</body></html>